.\" Copyright (c) 1980, 1991 Regents of the University of California.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\"    must display the following acknowledgement:
.\"	This product includes software developed by the University of
.\"	California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"     @(#)swapon.8	6.3 (Berkeley) 3/16/91
.\"
.\" Sun Dec 27 12:31:30 1992: Modified by faith@cs.unc.edu
.\" Sat Mar  6 20:46:02 1993: Modified by faith@cs.unc.edu
.\" Sat Oct  9 09:35:30 1993: Converted to man format by faith@cs.unc.edu
.\" Sat Nov 27 20:22:42 1993: Updated authorship information, faith@cs.unc.edu
.\" Mon Sep 25 14:12:38 1995: Added -v and -p information
.\" Tue Apr 30 03:32:07 1996: Added some text from A. Koppenhoefer
.\"
.TH SWAPON 8 "25 September 1995" "Linux 1.x" "Linux Programmer's Manual"
.SH NAME
swapon, swapoff \- 使用/关闭用于分页和交换的文件和设备

.SH "总览 (SYNOPSIS)"
.B /sbin/swapon [\-h \-V]
.br
.B /sbin/swapon \-a [\-v]
.br
.BI "/sbin/swapon [\-v] [\-p " "priority" "] " " specialfile " ...
.br
.B /sbin/swapon [\-s]
.br
.B /sbin/swapoff [\-h \-V]
.br
.B /sbin/swapoff \-a
.br
.BI /sbin/swapoff " specialfile " ...

.SH "描述 (DESCRIPTION)"
.B Swapon
指出 用于 分页和交换 的 设备.
一般 在 系统 多用户运行级 的 初始化文件
.I /etc/rc
中 调用
.B swapon ,
使 所有的 交换设备 生效, 因此 分页和交换 活动 可以 在 多个 设备和文件
之中 进行.

常用的形式有:
.TP
.B \-h
显示帮助
.TP
.B \-V
显示版本
.TP
.B \-s
显示交换设备的使用情况.这个选项需要
.I /proc/swaps
(小于 2.1.25 的 内核 可能没有).
.TP
.B \-a
使
.I /etc/fstab
中, 所有 标记了 'sw' 的 交换设备 生效.
.TP
.BI \-p " priority"
指定
.BR swapon 
的 优先级. 这个 选项 要求
.B swapon
在 1.3.2 或 更高 的 内核 上 编译 和 使用.
.I priority
介于 0 和 32767 之间. 关于 交换优先级 的 完整 描述 请 参看
.BR swapon (2) .
在
.I /etc/fstab
文件 中, 交换设备 的 选项域 里 加上
.BI pri= value ,
用
.BR "swapon -a"
可以 使其 生效.
.PP
.B Swapoff
禁止 在 指定的 设备和文件 上 做 交换, 如果 指定了
.B \-a
选项, 
.I /etc/fstab
中 所有的 交换设备 皆被 关闭.
.SH "注意 (NOTE)"
别在 包含 空洞(hole) 的 文件 上 使用
.B swapon .
.SH "参见 (SEE ALSO)"
.BR swapon "(2), " swapoff "(2), " fstab "(5), " init "(8), " mkswap (8),
.BR rc "(8), " mount (8)
.SH "文件 (FILES)"
.I /dev/hd??
标准分页设备
.br
.I /dev/sd??
标准 (SCSI) 分页设备
.br
.I /etc/fstab
ascii 格式的 文件系统 描述表
.SH "历史 (HISTORY)"
.B swapon
命令 源于 4.0BSD.

.SH "[中文版维护人]"
.B 徐明 <xuming@iname.com>
.SH "[中文版最新更新]"
.BR 2001/11/18
.SH "《中国Linux论坛man手册页翻译计划》"
.BI http://cmpp.linuxforum.net

